object frmMainGhost: TfrmMainGhost
  Left = 117
  Top = 146
  Width = 745
  Height = 532
  Caption = #35946#27743#32534#30721#26597#35810
  Color = clBtnFace
  Font.Charset = GB2312_CHARSET
  Font.Color = clWindowText
  Font.Height = -13
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  Menu = mm1
  OldCreateOrder = False
  Position = poDesktopCenter
  OnClose = FormClose
  OnCreate = FormCreate
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  object pnlCtrl: TPanel
    Left = 529
    Top = 0
    Width = 208
    Height = 478
    Align = alRight
    TabOrder = 0
    object Label1: TLabel
      Left = 16
      Top = 24
      Width = 67
      Height = 13
      Caption = 'BOM'#21333#21495#65306' '
    end
    object BitBtn1: TBitBtn
      Left = 96
      Top = 168
      Width = 81
      Height = 41
      Caption = #26597#35810'2'
      Default = True
      ModalResult = 1
      TabOrder = 0
      Visible = False
      OnClick = BitBtn1Click
      Glyph.Data = {
        F6000000424DF600000000000000760000002800000010000000100000000100
        0400000000008000000000000000000000001000000000000000000000000000
        8000008000000080800080000000800080008080000080808000C0C0C0000000
        FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888880008888
        8000888880808888808088888000788870008888800000000000000000800008
        00000888808000080000080080000000000008888800008000080CCCCCC00CCC
        00888C888880088800888C800800080800888C8888888888C8888CCCCCCCCCCC
        C8888C8CC8CC8CC8C8888CCCCCCCCCCCC8888888888888888888}
    end
    object Button1: TButton
      Left = 0
      Top = 256
      Width = 73
      Height = 25
      Caption = 'Button1'
      TabOrder = 1
      Visible = False
      OnClick = Button1Click
    end
    object Button3: TButton
      Left = 96
      Top = 232
      Width = 75
      Height = 25
      Caption = 'Button3'
      TabOrder = 2
      Visible = False
      OnClick = Button3Click
    end
    object Button6: TButton
      Left = 48
      Top = 184
      Width = 81
      Height = 33
      Caption = #20445#23384'BOM'
      TabOrder = 3
      Visible = False
      OnClick = Button6Click
    end
    object Button7: TButton
      Left = 48
      Top = 440
      Width = 81
      Height = 33
      Caption = #20195#30721
      TabOrder = 4
      Visible = False
      OnClick = Button7Click
    end
    object pb1: TProgressBar
      Left = 188
      Top = 1
      Width = 19
      Height = 270
      Align = alRight
      Min = 0
      Max = 100
      Step = 1
      TabOrder = 5
    end
    object cbb1: TComboBox
      Left = 8
      Top = 48
      Width = 145
      Height = 21
      ItemHeight = 13
      TabOrder = 6
      Text = 'BOM000030'
    end
    object cbb2: TComboBox
      Left = 96
      Top = 264
      Width = 81
      Height = 21
      ItemHeight = 13
      TabOrder = 7
      Text = 'cbb2'
      Visible = False
    end
    object Button9: TButton
      Left = 48
      Top = 224
      Width = 81
      Height = 33
      Caption = #25171#21360#39044#35272
      TabOrder = 8
      Visible = False
      OnClick = Button9Click
    end
    object pnl1: TPanel
      Left = 1
      Top = 271
      Width = 206
      Height = 206
      Align = alBottom
      BevelOuter = bvLowered
      TabOrder = 9
      object lblDataBase: TLabel
        Left = 8
        Top = 8
        Width = 59
        Height = 13
        Caption = #25968#25454#24211#65306' '
      end
      object Button4: TButton
        Left = 48
        Top = 56
        Width = 81
        Height = 33
        Caption = #35843#20837#29289#26009#34920
        TabOrder = 0
        Visible = False
        OnClick = Button4Click
      end
      object btnConnectServer: TButton
        Left = 48
        Top = 37
        Width = 81
        Height = 33
        Caption = #36830#25509#26381#21153#22120
        TabOrder = 1
        OnClick = btnConnectServerClick
      end
      object Button10: TButton
        Left = 48
        Top = 96
        Width = 81
        Height = 33
        Caption = #20445#23384#29289#26009#34920
        TabOrder = 2
        Visible = False
        OnClick = Button10Click
      end
      object Button11: TButton
        Left = 48
        Top = 136
        Width = 81
        Height = 33
        Caption = #35843#20837'Excel'
        TabOrder = 3
        Visible = False
        OnClick = Button11Click
      end
      object Button13: TButton
        Left = 0
        Top = 48
        Width = 75
        Height = 25
        Caption = 'Button13'
        TabOrder = 4
        Visible = False
        OnClick = Button13Click
      end
      object Button14: TButton
        Left = 120
        Top = 48
        Width = 75
        Height = 25
        Caption = 'Button14'
        TabOrder = 5
        Visible = False
        OnClick = Button14Click
      end
      object cbbDataBase: TComboBox
        Left = 56
        Top = 8
        Width = 145
        Height = 21
        ItemHeight = 13
        ItemIndex = 0
        TabOrder = 6
        Text = 'AIS20101102153154'
        Items.Strings = (
          'AIS20101102153154'
          'KIS_Sample')
      end
    end
    object Button12: TButton
      Left = 48
      Top = 136
      Width = 81
      Height = 33
      Caption = #26680#31639#20215#26684
      TabOrder = 10
      OnClick = Button12Click
    end
    object Button15: TButton
      Left = 49
      Top = 80
      Width = 80
      Height = 41
      Caption = #26597#35810
      TabOrder = 11
      OnClick = Button15Click
    end
  end
  object pnlPage: TPanel
    Left = 0
    Top = 0
    Width = 529
    Height = 478
    Align = alClient
    Caption = 'pnlPage'
    TabOrder = 1
    object pgcMain: TPageControl
      Left = 1
      Top = 1
      Width = 527
      Height = 476
      ActivePage = tsMain
      Align = alClient
      TabIndex = 3
      TabOrder = 0
      object ts1: TTabSheet
        Caption = #25104#21697#21322#21697'BOM'
        ImageIndex = 4
        object StringGrid3: TStringGrid
          Left = 0
          Top = 0
          Width = 519
          Height = 448
          Align = alClient
          ColCount = 10
          DefaultRowHeight = 18
          FixedCols = 0
          RowCount = 1000
          Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goColSizing, goRowSelect]
          TabOrder = 0
        end
      end
      object ts2: TTabSheet
        Caption = #23545#29031#34920
        ImageIndex = 5
        object spl1: TSplitter
          Left = 0
          Top = 185
          Width = 519
          Height = 3
          Cursor = crVSplit
          Align = alTop
        end
        object StringGrid2: TStringGrid
          Left = 0
          Top = 188
          Width = 519
          Height = 260
          TabStop = False
          Align = alClient
          BiDiMode = bdLeftToRight
          ColCount = 19
          Ctl3D = True
          DefaultRowHeight = 18
          FixedCols = 0
          RowCount = 80
          Font.Charset = GB2312_CHARSET
          Font.Color = clWindowText
          Font.Height = -13
          Font.Name = 'MS Sans Serif'
          Font.Style = []
          Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goColSizing, goRowSelect]
          ParentBiDiMode = False
          ParentCtl3D = False
          ParentFont = False
          ParentShowHint = False
          ShowHint = False
          TabOrder = 0
          ColWidths = (
            62
            64
            64
            64
            64
            64
            64
            64
            64
            64
            64
            64
            64
            64
            64
            64
            64
            64
            64)
        end
        object StringGrid1: TStringGrid
          Left = 0
          Top = 0
          Width = 519
          Height = 185
          Align = alTop
          DefaultRowHeight = 18
          FixedCols = 0
          RowCount = 40
          Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goColSizing, goRowMoving, goColMoving]
          TabOrder = 1
        end
      end
      object tsCache: TTabSheet
        Caption = #29289#26009#24635#34920
        ImageIndex = 3
        object Label4: TLabel
          Left = 200
          Top = 8
          Width = 21
          Height = 13
          Caption = '000'
          Font.Charset = GB2312_CHARSET
          Font.Color = clBlue
          Font.Height = -13
          Font.Name = 'MS Sans Serif'
          Font.Style = []
          ParentFont = False
          Visible = False
        end
        object Label3: TLabel
          Left = 128
          Top = 8
          Width = 65
          Height = 13
          Caption = #29992#26102#65288#31186#65289
          Font.Charset = GB2312_CHARSET
          Font.Color = clTeal
          Font.Height = -13
          Font.Name = 'MS Sans Serif'
          Font.Style = []
          ParentFont = False
          Visible = False
        end
        object Button5: TButton
          Left = 288
          Top = 40
          Width = 137
          Height = 25
          Caption = #24555#36895#29983#25104'EXCEL'
          Font.Charset = GB2312_CHARSET
          Font.Color = cl3DLight
          Font.Height = -13
          Font.Name = 'MS Sans Serif'
          Font.Style = []
          ParentFont = False
          TabOrder = 0
          Visible = False
          OnClick = Button5Click
        end
        object Button2: TButton
          Left = 304
          Top = 0
          Width = 89
          Height = 25
          Caption = #29983#25104#27979#35797#25968#25454
          TabOrder = 1
          Visible = False
          OnClick = Button2Click
        end
        object Edit1: TEdit
          Left = 424
          Top = 0
          Width = 65
          Height = 21
          ImeName = #20013#25991' ('#31616#20307') - '#29579#30721#20116#31508#22411'86'#29256
          TabOrder = 2
          Text = '2000'
          Visible = False
        end
        object UpDown1: TUpDown
          Left = 489
          Top = 0
          Width = 16
          Height = 21
          Associate = Edit1
          Min = 100
          Max = 10000
          Increment = 100
          Position = 2000
          TabOrder = 3
          Visible = False
          Wrap = False
        end
      end
      object tsMain: TTabSheet
        Caption = #25104#21697#25286#20998#26597#35810
        object strGdCode: TStringGrid
          Left = 0
          Top = 41
          Width = 519
          Height = 407
          Align = alClient
          ColCount = 10
          DefaultRowHeight = 18
          FixedCols = 0
          RowCount = 80
          Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing]
          TabOrder = 0
          OnDblClick = strGdCodeDblClick
        end
        object pnlPg1: TPanel
          Left = 0
          Top = 0
          Width = 519
          Height = 41
          Align = alTop
          BevelOuter = bvLowered
          TabOrder = 1
          object btnFindCode: TButton
            Left = 488
            Top = 0
            Width = 75
            Height = 25
            Caption = #26597#35810
            TabOrder = 0
            Visible = False
            OnClick = btnFindCodeClick
          end
          object edtCode: TEdit
            Left = 8
            Top = 12
            Width = 225
            Height = 21
            TabOrder = 1
            OnChange = edtCodeChange
          end
          object mmoCatchedt: TMemo
            Left = 416
            Top = 8
            Width = 233
            Height = 25
            TabOrder = 2
          end
          object cbbFinalProduct: TComboBox
            Left = 424
            Top = 8
            Width = 89
            Height = 21
            ItemHeight = 13
            ItemIndex = 0
            TabOrder = 3
            Text = #21452#39532#36798
            Visible = False
            Items.Strings = (
              #21452#39532#36798
              #21333#39532#36798
              #36965#25511#22120
              #25511#21046#30418)
          end
          object cbbSet: TComboBox
            Left = 320
            Top = 8
            Width = 81
            Height = 21
            ItemHeight = 13
            ItemIndex = 0
            TabOrder = 4
            Text = #26009#21495
            Items.Strings = (
              #26009#21495
              #35268#26684
              #21517#31216)
          end
          object btnFind: TButton
            Left = 240
            Top = 8
            Width = 75
            Height = 25
            Caption = #26597#35810
            TabOrder = 5
            OnClick = btnFindClick
          end
        end
      end
      object tsHelp: TTabSheet
        Caption = #24110#21161
        ImageIndex = 2
        object mmo2: TMemo
          Left = 0
          Top = 0
          Width = 519
          Height = 448
          Align = alClient
          Lines.Strings = (
            'Set Nocount On'
            '--'#21019#24314#20020#26102#34920' '
            
              'Create table #Temp ( fscstockname varchar(20) Null default '#39#39', F' +
              'ItemID    '
            
              #9'varchar(50) Null default '#39#39', FItemName  varchar(100) Null defau' +
              'lt '#39#39', '
            
              #9'FUnitName varchar(10) Null default '#39#39', FAuxPropName varchar(100' +
              ') Null default '#39#39', '
            #9'FAuxQty decimal(19,2) Null default 0 ) Declare @Tx varchar(10) '
            '--'#25554#20837#26126#32454
            
              'Insert Into #Temp Select t5.fname as fscstockname,v2.FItemid,t1.' +
              'fname as fitemname,t6.fname as funitname ,'
            
              #9't7.FName as FAuxPropName,sum(v2.fauxqty) as fauxqty From icstoc' +
              'kbill v1 Inner  Join icstockbillentry v2'
            
              ' '#9'On v2.Finterid = v1.FInterID Inner Join t_ICItem t1 On v2.FIte' +
              'mID=t1.FItemID Left outer join t_stock t5 '
            
              #9'on v1.fdcstockid=t5.fitemid Left Join t_MeasureUnit t6 On t1.FU' +
              'nitID = t6.FMeasureUnitID left join t_auxitem t7 '
            #9'on v2.fauxpropid = t7.fitemid '
            'Where v1.fcancellation = 0 And v1.ftrantype = 1 '
            #9'and {strDateFrom} and {strDateTo}'
            #9'and {strItemIDFrom} and {strItemIDTo}'
            'group by v2.FItemid,t1.fname,t5.fname,t6.fname,t7.FName'
            '--'#25554#20837#23567#35745
            
              'Insert Into #Temp(fscstockname,FAuxQty) Select t5.fname + '#39'('#23567#35745')'#39 +
              ' as fscstockname ,sum(v2.fauxqty) as fauxqty '
            
              #9'From icstockbill v1 Inner  Join icstockbillentry v2 On v2.Finte' +
              'rid = v1.FInterID Inner Join t_ICItem t1'
            
              ' '#9'On v2.FItemID=t1.FItemID Left outer join t_stock t5 on v1.fdcs' +
              'tockid=t5.fitemid '
            'Where v1.fcancellation = 0 And v1.ftrantype = 1 '
            #9'and {strDateFrom} and {strDateTo}'
            #9'and {strItemIDFrom} and {strItemIDTo}'
            'group by t5.fname '
            '--'#25554#20837#24635#35745
            
              'Insert Into #Temp(fscstockname,FAuxQty) Select  '#39#24635#35745#39',sum(v2.faux' +
              'qty) as fauxqty '
            
              #9'From icstockbill v1 Inner  Join icstockbillentry v2 On v2.Finte' +
              'rid = v1.FInterID '
            
              #9'Inner Join t_ICItem t1 On v2.FItemID=t1.FItemID Left outer join' +
              ' t_stock t5 on v1.fdcstockid=t5.fitemid '
            'Where v1.fcancellation = 0 '
            #9'And v1.ftrantype = 1 '
            '        and {strDateFrom} and {strDateTo}'
            #9'and {strItemIDFrom} and {strItemIDTo}'
            '--'#20174#20020#26102#34920#21462#20986#25968#25454
            'Select * from #Temp order by fscstockname '
            '--'#21024#38500#20020#26102#34920
            'Drop table #Temp '
            'Set Nocount Off')
          ScrollBars = ssBoth
          TabOrder = 0
        end
      end
      object tsSet: TTabSheet
        Caption = 'SQL'#20195#30721
        ImageIndex = 1
        object mmo1: TMemo
          Left = 0
          Top = 178
          Width = 519
          Height = 125
          Align = alClient
          Lines.Strings = (
            ' Set NoCount On '
            'Create Table #DATA ( FSumSort decimal(28, 10)  null Default(0), '
            '     FGroupNo varchar(250) null, '
            '     FBOMBillNo varchar(250) null,'
            '     FEntryID int null,'
            '     FItemNumber varchar(255) null,'
            '     FItemName varchar(255) null, '
            '     FModel varchar(255) null, '
            '     FMaterielType varchar(255) null, '
            '     FAuxProp varchar(255) null, '
            '     FBaseUnitName varchar(80) null , '
            '     FBaseQty decimal(28, 10) null , '
            '     FUnitName varchar(80) null , '
            '     FQty decimal(28, 10) null , '
            '     FFee decimal(28, 10) null , '
            '     FScrap decimal(28, 10) null , '
            '     FUseStatus  varchar(80) null ,'
            '     FStock varchar(80) null , '
            '     FNote varchar(1000) null ,'
            '     FChecked varchar(80) null  ) '
            
              ' Insert Into #DATA (FSumSort,FGroupNo,FBOMBillNo,FEntryID,FItemN' +
              'umber,FItemName,FModel, '
            
              ' FMaterielType,FAuxProp,FBaseUnitName,FBaseQty,FUnitName,FQty,FF' +
              'ee,FScrap,FUseStatus,FStock,FNote,FChecked) '
            
              ' SELECT a.FinterID as FSumSort, t1.FNumber AS FGroupNo, a.FBOMNu' +
              'mber as FBOMBillNo,Null AS FEntryID ,'
            
              '     b.FNumber as FItemNumber,b.FName as FItemName,b.FModel as F' +
              'Model,'
            
              '     e.FName AS FMaterielType,t9.FName as FAuxProp,'#39#39' as FBaseUn' +
              'itName,Null as FBaseQty,'
            '     c.FName AS FUnitName,a.FQty as FQty,a.FFee,Null as FScrap,'
            
              '     CASE FUseStatus WHEN 1072 THEN '#39#20351#29992#39' ELSE '#39#26410#20351#29992#39' END AS FUseS' +
              'tatus,'
            '     Null as FStock,a.FNote as FNote,'
            '     case a.FStatus when 0 then '#39#26410#23457#26680#39' else '#39#24050#23457#26680#39' end as FChecked'
            ' FROM ICBOM a INNER JOIN t_ICItem b ON a.FItemID = b.FItemID'
            '     INNER JOIN t_MeasureUnit c ON a.FUnitID=c.FItemID'
            '     INNER JOIN t_submessage e ON  b.FErpClsID = e.FInterID'
            '     LEFT JOIN t_AuxItem t9 ON a.FAuxPropID = t9.FItemID'
            '     LEFT JOIN ICBomGroup t1 ON a.FParentID = t1.FInterID'
            ' Where 1=1 '
            
              ' Insert Into #DATA (FSumSort,FGroupNo,FBOMBillNo,FEntryID,FItemN' +
              'umber,FItemName,FModel, '
            
              ' FMaterielType,FAuxProp,FBaseUnitName,FBaseQty,FUnitName,FQty,FF' +
              'ee,FScrap,FUseStatus,FStock,FNote,FChecked) '
            
              ' SELECT a.FInterID+0.1 as FSumSort,t1.FNumber AS FGroupNo,a1.FBO' +
              'MNumber as FBOMBillNo,'
            
              '     a.FEntryID as FEntryID, tt.FNumber as FItemNumber,tt.FName ' +
              'AS FItemName,tt.FModel as FModel,'
            
              '     e.FName AS FMaterielType,t9.FName as FAuxProp,d.FName AS FB' +
              'aseUnitName,a.FAuxQty as FBaseQty,'
            
              '     w.FName as FUnitName,a.FQty as FQty,0 as FFee,a.FScrap as F' +
              'Scrap,g.FName AS FUseStatus,'
            '     c.FName AS FStock,a.FNote as FNote,'#39#39' as FChecked'
            
              ' FROM IcBom a1 INNER JOIN ICBOMChild a ON  a1.FinterId = a.Finte' +
              'rID'
            '     LEFT JOIN ICBomGroup t1 ON a1.FParentID = t1.FInterID'
            '     inner join t_ICItem tt on a.FItemID = tt.FItemID'
            
              '     left join (SELECT FItemID,FName FROM t_Stock UNION SELECT 0' +
              ' AS FItemID,'#39#39' AS FName) c'
            '     on ISNULL(a.FStockID,0) = c.FItemID'
            '     LEFT JOIN t_AuxItem t9 ON a.FAuxPropID = t9.FItemID'
            '     left join t_MeasureUnit d on tt.FUnitID = d.FItemID'
            '     left join t_SubMessage e on a.FMaterielType = e.FInterID'
            '     left join t_SubMessage g on tt.FUseState = g.FInterID'
            '     left join t_MeasureUnit w on a.FunitID=w.FitemID'
            '     inner join t_ICItem b on a1.FItemID = b.FItemID'
            ' Where 1=1 '
            ' Select FGroupNo,FBOMBillNo,FEntryID, '
            ' FItemNumber,FItemName,ab.FModel, '
            ' FMaterielType,FAuxProp,FBaseUnitName,FBaseQty, '
            ' FUnitName,FQty,FFee,FScrap, '
            ' FUseStatus,FStock,ab.FNote, FChecked,fitemid '
            
              ' from #DATA ab left join t_icitem ba on ab.fitemnumber = ba.fnum' +
              'ber  where FBOMBillNo='
            ''
            ''
            '')
          ScrollBars = ssBoth
          TabOrder = 0
          Visible = False
        end
        object mmo3: TMemo
          Left = 0
          Top = 303
          Width = 519
          Height = 56
          Align = alBottom
          Lines.Strings = (
            'order by FSumSort'
            ' Drop table #DATA '
            ' Set NoCount off ')
          TabOrder = 1
          Visible = False
        end
        object mmo4: TMemo
          Left = 0
          Top = 359
          Width = 519
          Height = 89
          Align = alBottom
          Lines.Strings = (
            'Select fnumber as "'#26009#21495'",fname as "'#21517#31216'",'
            '       fmodel as "'#35268#26684'",fnote as "'#22791#27880'",fitemid from t_icitem')
          TabOrder = 2
          Visible = False
        end
        object mmo5: TMemo
          Left = 0
          Top = 0
          Width = 519
          Height = 89
          Align = alTop
          Lines.Strings = (
            'mmo5')
          TabOrder = 3
          Visible = False
        end
        object mmo6: TMemo
          Left = 0
          Top = 89
          Width = 519
          Height = 89
          Align = alTop
          Lines.Strings = (
            'Set NoCount On '
            
              '  Create Table #DATA ( FSumSort decimal(28, 10)  null Default(0)' +
              ', '
            '     FGroupNo varchar(250) null, '
            '     FBOMBillNo varchar(250) null,'
            '     FEntryID int null,'
            '     FItemNumber varchar(255) null,'
            '     FItemName varchar(255) null, '
            '     FModel varchar(255) null, '
            '     FMaterielType varchar(255) null, '
            '     FAuxProp varchar(255) null, '
            '     FBaseUnitName varchar(80) null , '
            '     FBaseQty decimal(28, 10) null , '
            '     FUnitName varchar(80) null , '
            '     FQty decimal(28, 10) null , '
            '     FFee decimal(28, 10) null , '
            '     FScrap decimal(28, 10) null , '
            '     FUseStatus  varchar(80) null ,'
            '     FStock varchar(80) null , '
            '     FNote varchar(1000) null ,'
            '     FChecked varchar(80) null  ) '
            
              ' Insert Into #DATA (FSumSort,FGroupNo,FBOMBillNo,FEntryID,FItemN' +
              'umber,FItemName,FModel, '
            
              ' FMaterielType,FAuxProp,FBaseUnitName,FBaseQty,FUnitName,FQty,FF' +
              'ee,FScrap,FUseStatus,FStock,FNote,FChecked) '
            
              ' SELECT a.FinterID as FSumSort, t1.FNumber AS FGroupNo, a.FBOMNu' +
              'mber as FBOMBillNo,Null AS FEntryID ,'
            
              '     b.FNumber as FItemNumber,b.FName as FItemName,b.FModel as F' +
              'Model,'
            
              '     e.FName AS FMaterielType,t9.FName as FAuxProp,'#39#39' as FBaseUn' +
              'itName,Null as FBaseQty,'
            '     c.FName AS FUnitName,a.FQty as FQty,a.FFee,Null as FScrap,'
            
              '     CASE FUseStatus WHEN 1072 THEN '#39#20351#29992#39' ELSE '#39#26410#20351#29992#39' END AS FUseS' +
              'tatus,'
            '     Null as FStock,a.FNote as FNote,'
            '     case a.FStatus when 0 then '#39#26410#23457#26680#39' else '#39#24050#23457#26680#39' end as FChecked'
            ' FROM ICBOM a INNER JOIN t_ICItem b ON a.FItemID = b.FItemID'
            '     INNER JOIN t_MeasureUnit c ON a.FUnitID=c.FItemID'
            '     INNER JOIN t_submessage e ON  b.FErpClsID = e.FInterID'
            '     LEFT JOIN t_AuxItem t9 ON a.FAuxPropID = t9.FItemID'
            '     LEFT JOIN ICBomGroup t1 ON a.FParentID = t1.FInterID'
            ' Where 1=1 '
            
              ' Insert Into #DATA (FSumSort,FGroupNo,FBOMBillNo,FEntryID,FItemN' +
              'umber,FItemName,FModel, '
            
              ' FMaterielType,FAuxProp,FBaseUnitName,FBaseQty,FUnitName,FQty,FF' +
              'ee,FScrap,FUseStatus,FStock,FNote,FChecked) '
            
              ' SELECT a.FInterID+0.1 as FSumSort,t1.FNumber AS FGroupNo,a1.FBO' +
              'MNumber as FBOMBillNo,'
            
              '     a.FEntryID as FEntryID, tt.FNumber as FItemNumber,tt.FName ' +
              'AS FItemName,tt.FModel as FModel,'
            
              '     e.FName AS FMaterielType,t9.FName as FAuxProp,d.FName AS FB' +
              'aseUnitName,a.FAuxQty as FBaseQty,'
            
              '     w.FName as FUnitName,a.FQty as FQty,0 as FFee,a.FScrap as F' +
              'Scrap,g.FName AS FUseStatus,'
            '     c.FName AS FStock,a.FNote as FNote,'#39#39' as FChecked'
            
              ' FROM IcBom a1 INNER JOIN ICBOMChild a ON  a1.FinterId = a.Finte' +
              'rID'
            '     LEFT JOIN ICBomGroup t1 ON a1.FParentID = t1.FInterID'
            '     inner join t_ICItem tt on a.FItemID = tt.FItemID'
            
              '     left join (SELECT FItemID,FName FROM t_Stock UNION SELECT 0' +
              ' AS FItemID,'#39#39' AS FName) c'
            '     on ISNULL(a.FStockID,0) = c.FItemID'
            '     LEFT JOIN t_AuxItem t9 ON a.FAuxPropID = t9.FItemID'
            '     left join t_MeasureUnit d on tt.FUnitID = d.FItemID'
            '     left join t_SubMessage e on a.FMaterielType = e.FInterID'
            '     left join t_SubMessage g on tt.FUseState = g.FInterID'
            '     left join t_MeasureUnit w on a.FunitID=w.FitemID'
            '     inner join t_ICItem b on a1.FItemID = b.FItemID'
            ' Where 1=1 '
            ' Select FBOMBillNo from #DATA '
            ''
            ' Drop table #DATA '
            ' Set NoCount off ')
          TabOrder = 4
          Visible = False
          WordWrap = False
        end
      end
      object ts3: TTabSheet
        Caption = 'ts3'
        ImageIndex = 6
        object dbgrdh1: TStringGrid
          Left = 80
          Top = 16
          Width = 320
          Height = 120
          TabOrder = 0
        end
        object dbgrdh2: TStringGrid
          Left = 112
          Top = 208
          Width = 320
          Height = 120
          TabOrder = 1
        end
      end
      object ts4: TTabSheet
        Caption = 'ts4'
        ImageIndex = 7
        object AdvStringGrid1: TAdvStringGrid
          Left = 0
          Top = 0
          Width = 519
          Height = 448
          Cursor = crDefault
          Align = alClient
          Font.Charset = GB2312_CHARSET
          Font.Color = clWindowText
          Font.Height = -13
          Font.Name = 'Tahoma'
          Font.Style = []
          Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing]
          ParentFont = False
          ScrollBars = ssBoth
          TabOrder = 0
          ActiveCellFont.Charset = DEFAULT_CHARSET
          ActiveCellFont.Color = clWindowText
          ActiveCellFont.Height = -11
          ActiveCellFont.Name = 'Tahoma'
          ActiveCellFont.Style = [fsBold]
          ActiveCellColor = 15387318
          ControlLook.FixedGradientFrom = clWhite
          ControlLook.FixedGradientTo = clBtnFace
          ControlLook.FixedGradientHoverFrom = 13619409
          ControlLook.FixedGradientHoverTo = 12502728
          ControlLook.FixedGradientHoverMirrorFrom = 12502728
          ControlLook.FixedGradientHoverMirrorTo = 11254975
          ControlLook.FixedGradientDownFrom = 8816520
          ControlLook.FixedGradientDownTo = 7568510
          ControlLook.FixedGradientDownMirrorFrom = 7568510
          ControlLook.FixedGradientDownMirrorTo = 6452086
          ControlLook.DropDownHeader.Font.Charset = DEFAULT_CHARSET
          ControlLook.DropDownHeader.Font.Color = clWindowText
          ControlLook.DropDownHeader.Font.Height = -11
          ControlLook.DropDownHeader.Font.Name = 'Tahoma'
          ControlLook.DropDownHeader.Font.Style = []
          ControlLook.DropDownHeader.Visible = True
          ControlLook.DropDownHeader.Buttons = <>
          ControlLook.DropDownFooter.Font.Charset = DEFAULT_CHARSET
          ControlLook.DropDownFooter.Font.Color = clWindowText
          ControlLook.DropDownFooter.Font.Height = -11
          ControlLook.DropDownFooter.Font.Name = 'MS Sans Serif'
          ControlLook.DropDownFooter.Font.Style = []
          ControlLook.DropDownFooter.Visible = True
          ControlLook.DropDownFooter.Buttons = <>
          Filter = <>
          FilterDropDown.Font.Charset = DEFAULT_CHARSET
          FilterDropDown.Font.Color = clWindowText
          FilterDropDown.Font.Height = -11
          FilterDropDown.Font.Name = 'MS Sans Serif'
          FilterDropDown.Font.Style = []
          FilterDropDownClear = '(All)'
          FixedRowHeight = 22
          FixedFont.Charset = DEFAULT_CHARSET
          FixedFont.Color = clWindowText
          FixedFont.Height = -11
          FixedFont.Name = 'Tahoma'
          FixedFont.Style = [fsBold]
          FloatFormat = '%.2f'
          PrintSettings.DateFormat = 'dd/mm/yyyy'
          PrintSettings.Font.Charset = DEFAULT_CHARSET
          PrintSettings.Font.Color = clWindowText
          PrintSettings.Font.Height = -11
          PrintSettings.Font.Name = 'MS Sans Serif'
          PrintSettings.Font.Style = []
          PrintSettings.FixedFont.Charset = DEFAULT_CHARSET
          PrintSettings.FixedFont.Color = clWindowText
          PrintSettings.FixedFont.Height = -11
          PrintSettings.FixedFont.Name = 'MS Sans Serif'
          PrintSettings.FixedFont.Style = []
          PrintSettings.HeaderFont.Charset = DEFAULT_CHARSET
          PrintSettings.HeaderFont.Color = clWindowText
          PrintSettings.HeaderFont.Height = -11
          PrintSettings.HeaderFont.Name = 'MS Sans Serif'
          PrintSettings.HeaderFont.Style = []
          PrintSettings.FooterFont.Charset = DEFAULT_CHARSET
          PrintSettings.FooterFont.Color = clWindowText
          PrintSettings.FooterFont.Height = -11
          PrintSettings.FooterFont.Name = 'MS Sans Serif'
          PrintSettings.FooterFont.Style = []
          PrintSettings.PageNumSep = '/'
          SearchFooter.ColorTo = 14215660
          SearchFooter.FindNextCaption = 'Find &next'
          SearchFooter.FindPrevCaption = 'Find &previous'
          SearchFooter.Font.Charset = DEFAULT_CHARSET
          SearchFooter.Font.Color = clWindowText
          SearchFooter.Font.Height = -11
          SearchFooter.Font.Name = 'MS Sans Serif'
          SearchFooter.Font.Style = []
          SearchFooter.HighLightCaption = 'Highlight'
          SearchFooter.HintClose = 'Close'
          SearchFooter.HintFindNext = 'Find next occurence'
          SearchFooter.HintFindPrev = 'Find previous occurence'
          SearchFooter.HintHighlight = 'Highlight occurences'
          SearchFooter.MatchCaseCaption = 'Match case'
          Version = '5.0.2.0'
        end
      end
    end
  end
  object DataSource1: TDataSource
    DataSet = ADOTable1
    Left = 320
    Top = 96
  end
  object ADOTable1: TADOTable
    ConnectionString = 
      'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=TEST.mdb;Persist Se' +
      'curity Info=False'
    TableName = 'TEST'
    Left = 320
    Top = 32
  end
  object ADOQuery1: TADOQuery
    OnFetchProgress = ADOQuery1FetchProgress
    Parameters = <>
    Left = 320
    Top = 64
  end
  object ADOQuery2: TADOQuery
    Connection = ADOConnection1
    CursorType = ctOpenForwardOnly
    LockType = ltReadOnly
    Parameters = <>
    Left = 368
    Top = 64
  end
  object ADOTable2: TADOTable
    Connection = ADOConnection1
    CursorType = ctOpenForwardOnly
    LockType = ltReadOnly
    TableName = 't_ICItem'
    Left = 368
    Top = 32
  end
  object ImageList1: TImageList
    Left = 320
    Top = 304
    Bitmap = {
      494C010101000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
      0000000000003600000028000000400000001000000001002000000000000010
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000C4916300A04D0000A04D0000A04D0000A04D0000A04D0000B97C45000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000000000000000000000000000A04D
      0000A04D0000A04D0000A04D0000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000A04D0000A04D
      0000A04D0000CA9D730000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      00000000000000000000000000000000000000000000A2510600A04D0000A04D
      0000CA9D73000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      00000000000000000000000000000000000000000000A04D0000A04D0000A04D
      0000000000000000000000000000000000000000000000000000000000004EC4
      85002FBA70002AB76E0052C58800000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000B5733800A04D0000A04D0000A04D
      0000000000000000000000000000000000000000000035BA72002AB76E002AB8
      6D002AB86D002AB86D002AB86D00000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000A04D0000A04D0000A04D0000A04D
      0000A04D0000000000000000000000000000000000002AB86D002AB86D002FBA
      70002AB76E002AB86D002AB86D00000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000A04D0000A04D0000A04D0000A04D
      0000A04D0000A04D0000000000000000000000000000000000002FBA70002AB8
      6D002FBA70002AB86D002FBA7000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000A4540B00A04D0000A04D0000A04D
      0000A04D0000A04D0000D2AB8800000000000000000000000000000000002FBA
      70002AB86D002AB86D002FBA7000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000CA9D7300A04D0000A04D0000A04D
      0000A04D0000A04D000000000000000000000000000000000000000000002AB8
      6D002FBA70002AB86D002AB86D00000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      00000000000000000000000000000000000000000000A04D0000A04D0000A04D
      0000A24E04000000000000000000000000000000000000000000000000002FBA
      70002AB86D002AB86D0000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      00000000000000000000000000000000000000000000C6936900C18B5B000000
      00000000000000000000000000000000000000000000000000003CBE78002AB8
      6D002AB86D002FBA700000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      00000000000000000000000000000000000076D1A1002FBA70002AB76E002FBA
      70002AB86D000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      00000000000000000000000000000000000000000000000000000000000095D9
      B6002FBA70002FBA70002FBA70002FBA70002AB86D002AB86D002FBA70003CBE
      7800000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000A2DEBE0040BF7C002FBA700035BA720076D1A100000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000424D3E000000000000003E000000
      2800000040000000100000000100010000000000800000000000000000000000
      000000000000000000000000FFFFFF00FFFF000000000000F01F000000000000
      E1FF000000000000C3FF00000000000087FF0000000000008FE1000000000000
      0F81000000000000078100000000000003C100000000000001E1000000000000
      03E100000000000087E30000000000009FC3000000000000FF07000000000000
      E00F000000000000F83F00000000000000000000000000000000000000000000
      000000000000}
  end
  object ADOConnection1: TADOConnection
    CommandTimeout = 60
    ConnectionTimeout = 60
    ConnectOptions = coAsyncConnect
    CursorLocation = clUseServer
    IsolationLevel = ilBrowse
    LoginPrompt = False
    Provider = 'SQLOLEDB.1'
    Left = 320
    Top = 168
  end
  object ADOCommand1: TADOCommand
    Connection = ADOConnection1
    Parameters = <>
    Left = 320
    Top = 136
  end
  object DataSource2: TDataSource
    AutoEdit = False
    DataSet = ADOQuery2
    Left = 368
    Top = 96
  end
  object SaveDialog1: TSaveDialog
    Filter = 'xls'
    Left = 320
    Top = 400
  end
  object ADOQuery3: TADOQuery
    Connection = ADOConnection1
    OnFetchProgress = ADOQuery3FetchProgress
    Parameters = <>
    Left = 416
    Top = 64
  end
  object DataSource3: TDataSource
    DataSet = ADOQuery3
    Left = 416
    Top = 96
  end
  object CSGlobalObject1: TCSGlobalObject
    Left = 360
    Top = 400
  end
  object tmr1: TTimer
    Interval = 300
    OnTimer = tmr1Timer
    Left = 320
    Top = 336
  end
  object ADOQuery4: TADOQuery
    Connection = ADOConnection1
    ExecuteOptions = [eoAsyncExecute, eoAsyncFetch]
    OnFetchProgress = ADOQuery4FetchProgress
    Parameters = <>
    Left = 464
    Top = 64
  end
  object DataSource4: TDataSource
    DataSet = ADOQuery4
    Left = 464
    Top = 96
  end
  object mm1: TMainMenu
    Left = 320
    Top = 208
    object mniN1: TMenuItem
      Caption = #25511#21046
      object mniN5: TMenuItem
        Caption = #36830#25509#26381#21153#22120
        OnClick = mniN5Click
      end
      object mniN6: TMenuItem
        Caption = #26597#35810
        Visible = False
        OnClick = mniN6Click
      end
      object mniExcel1: TMenuItem
        Caption = #20445#23384#21040'Excel'
        Visible = False
        OnClick = mniExcel1Click
      end
      object mniN8: TMenuItem
        Caption = #25171#21360#39044#35272
        Visible = False
      end
    end
    object mniN2: TMenuItem
      Caption = #26174#31034
      object mniN7: TMenuItem
        Caption = #38544#34255#20391#36793#26639
        OnClick = mniN7Click
      end
      object mniN11: TMenuItem
        Caption = #26368#23567#21270#21040#20219#21153#26639
        OnClick = mniN11Click
      end
    end
    object mniN3: TMenuItem
      Caption = #35774#32622
    end
    object mniN4: TMenuItem
      Caption = #24110#21161
    end
  end
  object prntdbgrdh1: TPrintDBGridEh
    Options = []
    PageFooter.Font.Charset = DEFAULT_CHARSET
    PageFooter.Font.Color = clWindowText
    PageFooter.Font.Height = -11
    PageFooter.Font.Name = 'MS Sans Serif'
    PageFooter.Font.Style = []
    PageHeader.Font.Charset = DEFAULT_CHARSET
    PageHeader.Font.Color = clWindowText
    PageHeader.Font.Height = -11
    PageHeader.Font.Name = 'MS Sans Serif'
    PageHeader.Font.Style = []
    Units = MM
    Left = 320
    Top = 272
  end
  object DBSumList1: TDBSumList
    DataSet = ADOQuery2
    ExternalRecalc = False
    SumCollection = <>
    VirtualRecords = False
    Left = 320
    Top = 240
  end
  object dlgSave1: TSaveDialog
    Filter = 'xls'
    Left = 320
    Top = 368
  end
  object ADOQuery5: TADOQuery
    CursorLocation = clUseServer
    Parameters = <>
    Left = 512
    Top = 64
  end
end
